<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <!-- 360浏览器，使用ie标准内核展示本页面 -->
    <meta name="renderer" content="ie-stand">
    <!-- 使用ie8以上内核 -->
    <meta http-equiv="X-UA-Compatible" content="IE=11">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查看影像</title>
</head>

<body>
    <div id="imgObjDiv">
        <object id='imageDisplay' classid='clsid:DF02961E-E2F3-41a6-AACB-010EF4A90F9F'></object>
    </div>
    <script>
        /** 关闭当前页面 */
        function closeSelf() {
            window.opener = null;
            window.open('', '_self');
            window.close()
        }

        /** 从url中获取请求参数 */
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return decodeURIComponent(r[2]);
            }
            return null;
        }

        //加载影像
        var str = getQueryString('str');
        var imgServerUrl = getQueryString('imgServerUrl');
        imageDisplay = document.getElementById("imageDisplay");
        // imageDisplay.DisplayFile(str, imgServerUrl); OpenDisplayFile2

        // 契约影像下载权限添加  start
        var downloadPower = getQueryString('downloadPower');
        var watermark = "中信保诚" + getQueryString('watermark');
        var power = false;
        if (downloadPower === "true") {
            power = true;
        }
        console.log("影像查看器参数: " + str + "," + imgServerUrl + "," + watermark + "," + power)
        imageDisplay.OpenDisplayFile2(str, imgServerUrl, 1, watermark, false,true,false,50);
        // 契约影像下载权限添加  end
        setTimeout(closeSelf,30);//自动关闭当前页面
    </script>
</body>

</html>
